//---------------------------------------------------------------------------

#ifndef GlobalVariablesH
#define GlobalVariablesH

// MOTION parameters
////////////////////////////////////////////////////////////////////////////////////////////////////
//....................................................................................................
// Actual data
#define STEP_F_DISTANCE  			1.75 // Positive
#define STEP_B_DISTANCE  			-1.5 // Negative
//....................................................................................................
#define SHIFT_R_DISTANCE 			2.25 // Positive
#define SHIFT_L_DISTANCE 			-2.75 // Negative
#define SHIFT_RR_DISTANCE 			5 // Positive
#define SHIFT_LL_DISTANCE 		-5 // Negative
//....................................................................................................
#define TURN_R_ANGLE 						2  // Positive
#define TURN_L_ANGLE 					-6 // Negative
#define TURN_RR_ANGLE 				17.5 // Positive
#define TURN_LL_ANGLE 				-22  // Negative
//....................................................................................................
#define TURNBALL_R_ANGLE 			10  // Positive
#define TURNBALL_L_ANGLE 			-10 // Negative
//....................................................................................................
#define WALK_F_DISTANCE 			5 // Positive
#define WALK_B_DISTANCE 			-3
#define WALK_FR_DISTANCE 			5
#define WALK_FR_ANGLE    			3 // Positive
#define WALK_FL_DISTANCE 			5
#define WALK_FL_ANGLE    			-3 // Negative
#define WALK_BR_DISTANCE 			-5
#define WALK_BR_ANGLE    			3 // Positive
#define WALK_BL_DISTANCE 			-5
#define WALK_BL_ANGLE    			-3 // Negative
//....................................................................................................

// Define
typedef struct
{
	unsigned char InUB[MOTOR_NUM_UB];
	unsigned char InRL[MOTOR_NUM_RL];
	unsigned char InLL[MOTOR_NUM_LL];
} MotorIDStruct;

typedef struct
{
	short InUB[MOTOR_NUM_UB];
	short InRL[MOTOR_NUM_RL];
	short InLL[MOTOR_NUM_LL];
} MotorCorrectionStruct;


// Motor
extern const float MX106_Resolution;

extern const int MotorNum[BODYPART_NUM];
extern const MotorIDStruct MotorID;
extern const MotorCorrectionStruct MotorCorrection_Intrinsic;
extern MotorCorrectionStruct MotorCorrection_Feedback;

// Computer
extern mem_information *Mem_Info;
extern CShareMem *ShareMemServer;
extern bool bCommunicateCompWithShareMemory;

// HMI
extern bool bCommunicateHMIWithShareMemory;

void InitialSetting(void);

// Show Information for debug
#define Memo_ShowInfo					FormShowInfo->Memo_ShowInfo
#define bShow_MotionModeRX		FormShowInfo->CheckBox_ShowMotionModeRX->Checked
#define bShow_HeadModeRX			FormShowInfo->CheckBox_ShowHeadModeRX->Checked
#define bShow_CompReceive			FormShowInfo->CheckBox_ShowCompReceive->Checked
#define bShow_CompSend				FormShowInfo->CheckBox_ShowCompSend->Checked
#define bShow_CompRX					FormShowInfo->CheckBox_ShowCompRX->Checked
#define bShow_ScheduleError		FormShowInfo->CheckBox_ShowScheduleError->Checked
#define bShow_MotionDoing			FormShowInfo->CheckBox_ShowMotionDoing->Checked
#define bShow_MotorWrite			FormShowInfo->CheckBox_ShowMotorWrite->Checked
#define bShow_MotorRead				FormShowInfo->CheckBox_ShowMotorRead->Checked
#define bShow_ScheduleIndex		FormShowInfo->CheckBox_ShowScheduleIndex->Checked
#define bShow_HMIRX						FormShowInfo->CheckBox_ShowHMIRX->Checked
#define bShow_HMIReceive			FormShowInfo->CheckBox_ShowHMIReceive->Checked
#define bShow_HMIRemote				FormShowInfo->CheckBox_ShowRemote->Checked
#define bShow_Schedule				FormShowInfo->CheckBox_ShowSchedule->Checked
#define bShow_BoardRX					FormShowInfo->CheckBox_ShowBoardRX->Checked
#define bShow_BoardReceive		FormShowInfo->CheckBox_ShowBoardReceive->Checked
#define bShow_BoardSend				FormShowInfo->CheckBox_ShowBoardSend->Checked
#define bShow_RenewMotionInterval					FormShowInfo->CheckBox_RenewMotion_Interval->Checked
#define bShow_RenewMotionExecutionTime		FormShowInfo->CheckBox_RenewMotion_ExecutionTime->Checked
#define bShow_SensorAccessInterval				FormShowInfo->CheckBox_SensorAccess_Interval->Checked
#define bShow_SensorAccessExecutionTime		FormShowInfo->CheckBox_SensorAccess_ExecutionTime->Checked
#define bShow_MainProcessInterval					FormShowInfo->CheckBox_MainProcess_Interval->Checked
#define bShow_MainProcessExecutionTime		FormShowInfo->CheckBox_MainProcess_ExecutionTime->Checked
//---------------------------------------------------------------------------
#endif
